<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@include file="/web/header.jsp" %>
<title>添加</title>
</head>
<body>
<fieldset class="layui-elem-field" style="margin: 20px; padding: 20px;">
		<legend>信息维护--添加信息</legend>
		<div class="layui-field-box">
			<form class="layui-form layui-form-pane" method="post">
				<div class="layui-form-item">
					<label class="layui-form-label">部门编号</label>
					<div class="layui-input-inline">
						<input type="text" name="code" class="layui-input" lay-verify="required" placeholder="请输入部门编号" autocomplete="off"/>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">部门名称</label>
					<div class="layui-input-inline">
						<input type="text" name="name" class="layui-input" lay-verify="required" placeholder="请输入部门名称" autocomplete="off"/>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">电话号码</label>
					<div class="layui-input-inline">
						<input type="password" name="telephone" class="layui-input" lay-verify="required" placeholder="请输入电话号码" autocomplete="off"/>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-inline">
						<input type="button" value="添加" class="layui-btn" lay-submit lay-filter="add" />
						<input type="reset" value="重置" class="layui-btn layui-btn-primary"/>
					</div>
					<input type="button" class="layui-btn" value="取消" onclick="closeThis()"/>
				</div>
                <input type="hidden" name="action" value="add" />
			</form>
		</div>
	</fieldset>
<script type="text/javascript">
formSubmit('/DepartmentServlet','submit(add)','text',function(data){
	console.log(data);
	if(data==1){
		layer.msg("添加成功",closeThis);
	}else if(data=="repeat"){
		layer.msg("部门编号已存在");
	}else{
		layer.msg("添加失败");
	}
})
</script>
</body>
</html>